package net.jsoft.pms.vo.problems;

import java.util.Date;

public class ProblemTaskBean implements Comparable<ProblemTaskBean>
{
    private String id;
    private String optPerson;
    private String title;
    private String content;
    private String level;
    private String groupName;
    private Date insertDate;
    private long versions;

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getOptPerson()
    {
        return optPerson;
    }

    public void setOptPerson(String optPerson)
    {
        this.optPerson = optPerson;
    }

    public String getTitle()
    {
        return title;
    }

    public void setTitle(String title)
    {
        this.title = title;
    }

    public String getContent()
    {
        return content;
    }

    public void setContent(String content)
    {
        this.content = content;
    }

    public String getLevel()
    {
        return level;
    }

    public void setLevel(String level)
    {
        this.level = level;
    }

    public String getGroupName()
    {
        return groupName;
    }

    public void setGroupName(String groupName)
    {
        this.groupName = groupName;
    }

    public long getVersions()
    {
        return versions;
    }

    public void setVersions(long versions)
    {
        this.versions = versions;
    }

    public Date getInsertDate()
    {
        return insertDate;
    }

    public void setInsertDate(Date insertDate)
    {
        this.insertDate = insertDate;
    }

    @Override
    public int hashCode()
    {
        return this.getId().hashCode();
    }

    @Override
    public boolean equals(Object obj)
    {
        if (this.id != null && obj != null && this.id.equals(((ProblemTaskBean) obj).getId()))
        {
            return true;
        }
        else
        {
            return false;
        }

    }

    @Override
    public int compareTo(ProblemTaskBean o)
    {
        int i = this.getGroupName().compareTo(o.getGroupName());
        if (i != 0)
        {
            return i;
        }

        i = this.getOptPerson().compareTo(o.getOptPerson());
        if (i != 0)
        {
            return i;
        }

        i = this.getInsertDate().compareTo(o.getInsertDate());
        if (i != 0)
        {
            return i;
        }
        return this.getId().compareTo(o.getId());
    }

}
